# 一个Res响应模型，继承BaseModel
from pydantic import BaseModel, Field, validate_arguments


class Req(BaseModel):
    text: str = Field(...)

    @validate_arguments
    def text_must_not_be_empty(self, v):
        if not v:
            raise ValueError("text must not be empty")
        return v
